package com.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class UserDao {

    @Autowired
    JdbcTemplate jdbcTemplate;

    public void subBalance(int total){
        String sql = "update t_user set balance=balance-? where id = ?";
        jdbcTemplate.update(sql,total,1);
    }

}
